package com.gj.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
//往容器添加组件
@Configuration

public class ApplicationContextConfig {
    @Bean
    //@LoadBalanced //开启客户端负载均衡，ribbon轮询方式
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
